/* 全局样式重置 */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
    height: 100%;
    font-size: 16px;
}

body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #000;
}

#app {
    width: 100%;
    height: 100%;
    position: relative;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Cesium容器 - 使用百分比而非固定尺寸 */
#cesiumContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    z-index: 1;
}

/* 顶部标题栏 */
.title-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3.125rem; /* 50px */
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.6));
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.25rem; /* 20px */
    z-index: 2000;
}

.title-bar h1 {
    color: #fff;
    font-size: 1.125rem; /* 18px */
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.title-actions {
    display: flex;
    gap: 0.625rem; /* 10px */
}

.title-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 2rem; /* 32px */
    height: 2rem; /* 32px */
    border-radius: 0.25rem; /* 4px */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.title-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* 左侧模型控制面板 */
.left-panel {
    position: absolute;
    top: 4.375rem; /* 70px */
    left: 1.25rem; /* 20px */
    width: 20rem; /* 320px */
    max-height: calc(100vh - 8.75rem); /* 140px */
    overflow-y: auto;
    z-index: 1000;
}

.model-control-panel {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.95), rgba(40, 40, 40, 0.95));
    border-radius: 0.75rem; /* 12px */
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.4); /* 8px 32px */
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 右侧视图工具栏 */
.right-panel {
    position: absolute;
    top: 4.375rem; /* 70px */
    right: 1.25rem; /* 20px */
    width: 17.5rem; /* 280px */
    max-height: calc(100vh - 8.75rem); /* 140px */
    overflow-y: auto;
    z-index: 1000;
}

.view-toolbar {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.95), rgba(40, 40, 40, 0.95));
    border-radius: 0.75rem; /* 12px */
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.4); /* 8px 32px */
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 底部信息面板 */
.bottom-panel {
    position: absolute;
    bottom: 1.25rem; /* 20px */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.info-panel {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.95), rgba(40, 40, 40, 0.95));
    border-radius: 0.5rem; /* 8px */
    padding: 0.75rem 1.25rem; /* 12px 20px */
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.3); /* 4px 16px */
    min-width: 25rem; /* 400px */
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 12px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-label {
    color: #aaa;
    font-weight: 500;
    min-width: 50px;
}

.info-value {
    color: #fff;
    text-align: right;
    font-family: monospace;
}

/* 面板通用样式 */
.panel-header, .toolbar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
}

.panel-header h3, .toolbar-header h3 {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.toggle-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    min-width: 28px;
    text-align: center;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.panel-content, .toolbar-content {
    padding: 20px;
}

/* 控制组样式 */
.control-group, .control-section {
    margin-bottom: 20px;
}

.control-section h4 {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.control-group label {
    display: block;
    color: #ccc;
    font-size: 13px;
    margin-bottom: 8px;
    font-weight: 500;
}

.control-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 10px;
}

.control-row label {
    color: #ccc;
    font-size: 12px;
    margin-bottom: 0;
    min-width: 60px;
}

/* 输入控件样式 */
.number-input, .select-input, .file-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 13px;
    transition: all 0.2s;
}

.number-input:focus, .select-input:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
}

.range-input {
    flex: 1;
    accent-color: #00d4ff;
    margin-right: 10px;
}

.value-display {
    color: #00d4ff;
    font-size: 12px;
    font-weight: 600;
    min-width: 50px;
    text-align: right;
    font-family: monospace;
}

/* 文件输入特殊样式 */
.file-input-wrapper {
    margin-top: 4px;
}

.file-input {
    width: 100%;
    margin-bottom: 8px;
}

.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.file-name {
    color: #00d4ff;
    font-size: 12px;
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    color: #aaa;
    font-size: 11px;
    margin-left: 8px;
}

/* 复选框样式 */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #ccc !important;
    font-size: 13px !important;
    margin-bottom: 0 !important;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #00d4ff;
}

/* 按钮样式 */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-btn {
    width: 100%;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.action-btn.primary {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: #fff;
}

.action-btn.primary:hover {
    background: linear-gradient(135deg, #0099cc, #007aa3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.action-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.action-btn:disabled {
    background: #666;
    color: #999;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 导航按钮 */
.nav-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.nav-btn {
    flex: 1;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: #ccc;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: #00d4ff;
}

/* 加载指示器 */
.loading-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #00d4ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    color: #fff;
    font-size: 16px;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 滚动条样式 */
.left-panel::-webkit-scrollbar,
.right-panel::-webkit-scrollbar {
    width: 6px;
}

.left-panel::-webkit-scrollbar-track,
.right-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.left-panel::-webkit-scrollbar-thumb,
.right-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.left-panel::-webkit-scrollbar-thumb:hover,
.right-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Cesium工具栏样式调整 */
.cesium-viewer-toolbar {
    top: 70px;
    right: 320px;
}

.cesium-viewer-geocoderContainer {
    margin-right: 5px;
}

/* 隐藏Cesium的一些默认UI元素 */
.cesium-viewer-bottom {
    display: none;
}

.cesium-navigation-help {
    top: 120px;
    right: 320px;
}

/* 自定义Cesium按钮样式 */
.cesium-button {
    background: rgba(30, 30, 30, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

.cesium-button:hover {
    background: rgba(50, 50, 50, 0.9) !important;
}

/* 响应式设计 */
@media (max-width: 75rem) { /* 1200px */
    .left-panel {
        width: 17.5rem; /* 280px */
    }
    
    .right-panel {
        width: 16.25rem; /* 260px */
    }
}

@media (max-width: 48rem) { /* 768px */
    .title-bar h1 {
        font-size: 0.875rem; /* 14px */
    }
    
    .left-panel, .right-panel {
        width: calc(50vw - 1.875rem); /* 30px */
        max-height: calc(100vh - 10rem); /* 160px */
    }
    
    .left-panel {
        left: 0.625rem; /* 10px */
    }
    
    .right-panel {
        right: 0.625rem; /* 10px */
    }
    
    .bottom-panel {
        left: 0.625rem; /* 10px */
        right: 0.625rem; /* 10px */
        transform: none;
        width: calc(100vw - 1.25rem); /* 20px */
    }
    
    .info-panel {
        min-width: auto;
        width: 100%;
    }
}

@media (max-width: 30rem) { /* 480px */
    .left-panel, .right-panel {
        width: calc(100vw - 1.25rem); /* 20px */
        left: 0.625rem; /* 10px */
        right: 0.625rem; /* 10px */
    }
    
    .right-panel {
        top: auto;
        bottom: 6.25rem; /* 100px */
        max-height: 18.75rem; /* 300px */
    }
}

@media (max-height: 37.5rem) { /* 600px */
    .left-panel, .right-panel {
        max-height: calc(100vh - 7.5rem); /* 120px */
    }
}
